@extends('default.mobile.layouts.personalPublic')
@section('title','我的简历-'.Site::get('webname'))
{{--首页css--}}
@section('headcss')
    @parent
    <link rel="stylesheet" href="{{asset('/default/css/mobile/personal/my_resume.css')}}">
    @endsection

    {{--头部标签--}}
    @section('tag','我的简历')
@section('link') href="{{url('mobile/personal/welcome')}}" @endsection

    {{--主体内容--}}
    @section('content')
    <!-- E 头部 -->
    <div class="my_resume default">
        <h2>{{str_limit($resume->resume_name,24)}}<em>默认</em></h2>
        <ul>
            <li>完整度：{{$resume->percentage}}</li>
            <li>投递职位：{{$resume->resumeSendCount}}</li>
            <li>隐私：{{$resume->resume_status}}</li>
            <li>刷新：{{$resume->updatetime}}</li>
        </ul>
    </div>
    <div class="resume_operation">
        <ul>
            <li><a href="{{url('mobile/personal/resume_refresh?resume_id='.$resume->id)}}"><i class="icon01"></i>刷新</a></li>
            <li><a href="{{url('mobile/personal/resume_manage?resume_id='.$resume->id)}}"><i class="icon02"></i>修改</a></li>
            <li><a href="{{url('mobile/resume_'.idEncryption($resume->id).'.html')}}"><i class="icon03"></i>预览</a></li>
            <li><a href="{{url('mobile/personal/privacy?resume_id='.$resume->id)}}"><i class="icon04"></i>隐私</a></li>
        </ul>
    </div>
    <div class="my_resume create">
        <p>您还可以创建<strong>{{$countResume}}</strong>份简历!<a onclick="createResume('{{$countResume}}')">立即创建</a></p>
    </div>
    @if(count($moreResume) > 0)
        @foreach($moreResume as $v)
            <div class="my_resume">
                <div class="title">
                    <h2>{{str_limit($v->resume_name,20)}}</h2>
                    <span class="set_default"><a href="{{url('mobile/personal/set_default/'.$v->id)}}">设为默认</a></span>
                    <span class="set_default"><a onclick="del('{{$v->id}}')">删除</a></span>
                </div>
                <ul>
                    <li>完整度：{{$v->percentage}}</li>
                    <li>投递职位：{{$v->resumeSendCount}}</li>
                    <li>公开状态：{{$v->bkresume_status}}</li>
                    <li>刷新：{{$v->updatetime}}</li>
                </ul>
            </div>
            <div class="resume_operation">
                <ul>
                    <li><a href="{{url('mobile/personal/resume_refresh?resume_id='.$v->id)}}"><i class="icon01"></i>刷新</a></li>
                    <li><a href="{{url('mobile/personal/resume_manage?resume_id='.$v->id)}}"><i class="icon02"></i>修改</a></li>
                    <li><a href="{{url('mobile/resume_'.idEncryption($v->id).'.html')}}"><i class="icon03"></i>预览</a></li>
                    <li><a href="{{url('mobile/personal/privacy?resume_id='.$v->id)}}"><i class="icon04"></i>隐私</a></li>
                </ul>
            </div>
        @endforeach
    @endif
@endsection

@section('footerjs')
    @parent
    <script>
        $(function(){
            @if(session('success'))
                layerMsg("{{session('success')}}",1.5);
            @endif
        });
        /**
         * 删除简历
         * param resume_id
         */
        function del(resume_id){
            layer.open({
                content: '您确定要删除这个简历吗？'
                ,btn: ['确定', '取消']
                ,yes: function(index){
                    $.post("{{url('mobile/personal/del_resume/')}}/" + resume_id, {'_token': "{{csrf_token()}}"}, function(data){
                        if(data.status == 0){
                            layerMsg(data.msg,1);
                            location = '/mobile/personal/my_resume';
                        }else{
                            layerMsg(data.msg,1);
                        }
                    });
                }
            });
        }
        /**
         * 创建新简历
         * param countNumbei
         */
        function createResume(countNumber){
            if(countNumber <= 0){
                layerMsg('您的简历已经达到5份上限！',2);
            }else{
                location = '/mobile/personal/resume_create';
            }
        }
    </script>
@endsection
